import os

def main():
    pwd = os.getcwd()
    if not os.path.exists("./tools/pytorch-to-safetensor-converter") :
        os.system("git clone https://github.com/Silver267/pytorch-to-safetensor-converter ./tools/pytorch-to-safetensor-converter")
    os.system("cp ./tools/pytorch-to-safetensor-converter/convert_to_safetensor.py ../model/text2vec-base-chinese")
    os.chdir("../model/text2vec-base-chinese")
    os.system("python3 convert_to_safetensor.py")
    os.system("rm convert_to_safetensor.py")
    os.chdir(pwd)
    os.system("mv ../model/text2vec-base-chinese/text2vec-base-chinese_safetensors ./model/")
main()